package com.woniu.zsd.platform.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;
import java.time.LocalDateTime;

@Getter
@Setter
@Accessors(chain = true)
@TableName("chat_message")
@Entity
public class ChatMessage  implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("sender")
    private String sender;

    @TableField("receiver")
    private String receiver;
    @TableField("content")
    private String content;
    @TableField("type")
    private String type; // "text" 表示文本消息, "image" 表示图片消息, "file" 表示文件消息
    @TableField("timestamp")
    private LocalDateTime timestamp; // "chat" 表示聊天消息, "register" 表示用户注册

}